import request from '@/utils/request'

// 2、条件查询分类品牌列表
export const GetCategoryBrands = (pageNum, pageSize, searchObj) => {
  return request({
    url: `/admin/product/categoryBrand/list/${pageNum}/${pageSize}`,
    method: 'GET',
    //searchObj:  {brandId:1  , categoryId:1}
    params: searchObj,
  })
}
// 3、id查询分类品牌
export const GetCategoryBrandById = id => {
  return request({
    url: `/admin/product/categoryBrand/getById/${id}`,
    method: 'GET',
  })
}
// 4、更新分类品牌
export const UpdateCategoryBrand = categoryBrand => {
  return request({
    url: `/admin/product/categoryBrand/update`,
    method: 'PUT',
    data: categoryBrand,
  })
}
// 5、根据id删除分类品牌
export const DeleteCategoryBrand = id => {
  return request({
    url: `/admin/product/categoryBrand/delete/${id}`,
    method: 'DELETE',
  })
}
// 6、新增分类品牌
export const SaveCategoryBrand = categoryBrand => {
  return request({
    url: `/admin/product/categoryBrand/save`,
    method: 'POST',
    data: categoryBrand,
  })
}
//7、根据分类id查询品牌列表 GetBrandByCategoryId
export const GetBrandByCategoryId = categoryId => {
  return request({
    url: `/admin/product/categoryBrand/listBrandByC3id/${categoryId}`,
    method: 'GET',
  })
}
